package pl.pg.misra.AST;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Paweł Olczak
 */
public class AST {
    private String nodeType;
    private String line;
    private String source;

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getLine() {
        return line;
    }

    public void setLine(String line) {
        this.line = line;
    }
    private List<String> attributes;
    private List<AST> childrens;
    private AST parent;

    public AST getParent() {
        return parent;
    }

    public void setParent(AST parent) {
        this.parent = parent;
    }

    public List<String> getAttributes() {
        if (attributes == null) {
            attributes = new ArrayList<>();
        }

        return attributes;
    }

    public void setAttributes(List<String> attributes) {
        this.attributes = attributes;
    }

    public String getNodeType() {
        return nodeType;
    }

    public void setNodeType(String type) {
        this.nodeType = type;
    }
    
    public List<AST> getChildrens() {
        if (childrens == null) {
            childrens = new ArrayList<>();
        }
        
        return childrens;
    }

    public void setChildrens(List<AST> childrens) {
        this.childrens = childrens;
    }
}
